﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using com.vs.DataAccess;
using com.vs.DataAccess.DO;
using com.vs.General;
using com.vs.General.RF;

namespace com.vs.RF.Web.receiving
{
    public partial class ReceivingOptionsEntryHandling :RFHandlingPage
    {
        private string stPrefRecv;

        protected void Page_Load(object sender, EventArgs e)
        {
            stSourcePage = "receiving/ReceivingOptions.aspx";
            stTargetPage = "receiving/ReceiptIDEntry.aspx";
            go();
        }

        protected override void parseRequest()
        {
            stPrefRecv = Request["hdRecvPref"];
            if (StringManager.IsEmpty(stPrefRecv))
                stPrefRecv = Constants.stSTARDEFAULT;
        }

        protected override void procData()
        {
            ReceivingPreferenceDO prefDO = null;

            try
            {
                if (!StringManager.IsEmpty(stPrefRecv))
                {
                    prefDO = ReceivingPreferenceDO.GetModelByPK(rfSess, stPrefRecv);
                    if (prefDO != null)
                    {
                        Session[RFSupport.RECEIVING_PREFERENCE_DO] = prefDO;
                        return;
                    }
                    else
                    {
                        stError = "找不到收货选项";
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.LogException(rfSess, ex);
                stError = ex.Message;
            }
        }
    }
}
